package edu.towson.cosc603.coffeemaker;
import org.junit.Test;

import junit.framework.TestCase;

public class RecipeTest extends TestCase{
	private CoffeeMaker cm;
	private Inventory i;
	private Recipe r1;
	public Recipe r2;

	
	public void setUp() throws Exception {
		cm = new CoffeeMaker();
		i = cm.checkInventory();

		r1 = new Recipe();
		r1.setName("Coffee");
		r1.setPrice(50);
		r1.setAmtCoffee(3);
		r1.setAmtMilk(1);
		r1.setAmtSugar(1);
		r1.setAmtChocolate(0);
		cm.addRecipe(r1);		
	}
	
	

	@Test
	public void testSetAmtCoffee()
	{
		Recipe r2 = new Recipe();
		r2.setAmtCoffee(3);
		assertEquals(r2.getAmtCoffee(),3);
	}
	
	@Test
	public void testSetAmtCoffee1()
	{
		Recipe r2 = new Recipe();
		r2.setAmtCoffee(-1);
		assertEquals(r2.getAmtCoffee(),0);
	}
	
	
	@Test
	public void testsetAmtMilk()
	{
		Recipe r2 = new Recipe();
		r2.setAmtMilk(1);
		assertEquals(r2.getAmtMilk(),1);
	}
		
	@Test
	public void testSetAmtMilk1() {
		Recipe r2 = new Recipe();
		r2.setAmtMilk(-1);
		assertEquals(r2.getAmtMilk(),0);
	}
		
	@Test
	public void testSetAmtChocolate() {
		Recipe r2 = new Recipe();
		r2.setAmtChocolate(5);
		assertEquals(r2.getAmtChocolate(),5);
	}
		
	@Test
	public void testSetAmtChocolate1() {
		Recipe r2 = new Recipe();
		r2.setAmtChocolate(-1);
		assertEquals(r2.getAmtChocolate(),0);
	}
	

	@Test
	public void testsetAmtSugar()
	{
		Recipe r2 = new Recipe();
		r2.setAmtSugar(1);
		assertEquals(r2.getAmtSugar(),1);
	}
	
	@Test
	public void testSetAmtSugar1()
	{
		Recipe r2 = new Recipe();
		r2.setAmtSugar(-1);
		assertEquals(r2.getAmtSugar(),0);
	}

	
	@Test
	public void testGetPrice() {
		assertEquals(r1.getPrice(),50);
	}

	@Test
	public void testSetPrice() 
	{
	r2= new Recipe();
	r2.setPrice(-50);
	assertEquals(r2.getPrice(),0);
	}
	
	@Test
	public void testEquals()
	{
		r2= new Recipe();
		r2.setName("Coffee");
		assertTrue(r2.equals(r1));
	}
	
	@Test
	public void testEquals1()
	{
		r2= new Recipe();
		r2.setName("ChocolateMilk");
		assertFalse(r2.equals(r1));
	}
		
}

